﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>加载显示Bing地图</title>
    <!--必要的脚本引用-->
    <script include="jquery" src="./static/libs/include-lib-local.js"></script>
    <script src="./static/libs/include-openlayers-local.js"></script>
    <style type="text/css">
        #mapCon {
            width: 100%;
            height: 95%;
            position: absolute;
        }
    </style>
</head>

<body>
    <div id="mapCon"></div>
    <script type="text/javascript">
        //实例化Map对象加载地图
        var key =
            'Q57tupj2UBsQNQdju4xL~xBceblfTd6icjljunbuaCw~AhwA-whmGMsfIpVhslZyknWhFYq-GvWJZqBnqV8Zq1uRlI5YM_qr7_hxvdgnU7nH';
        var roads = new ol.layer.Tile({
            source: new ol.source.BingMaps({
                key: key,
                imagerySet: 'Road'
            })
        });
        var map = new ol.Map({
            layers: [roads],
            target: 'mapCon',
            view: new ol.View({
                center: ol.proj.fromLonLat([104, 30]),
                zoom: 4
            })
        });
    </script>
</body>

</html>
